#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
#include <boost/python/class.hpp>
#include <boost/python/list.hpp>


#include <string>

namespace py = boost::python;

namespace { // Avoid cluttering the global namespace.

class Config
{
private:
    std::string  m_sTitle;
    py::list     m_config;

public:
    void SetTitle(std::string sTitle) { m_sTitle = sTitle; }
    std::string GetTitle() const { return m_sTitle; }

    void SetConfig(py::list listConfig) { m_config = listConfig; }
    py::list GetConfig() const { return m_config; }
};


static Config config;

Config& GetConfig()
{
    return config;
}

}; // namespace

BOOST_PYTHON_MODULE(cfg)
{
    py::class_<Config>("Config")
        .def("setTitle"  , &Config::SetTitle)
        .def("getTitle"  , &Config::GetTitle)
        .def("setConfig" , &Config::SetConfig)
        .def("getConfig" , &Config::GetConfig);

    py::def("get", GetConfig, py::return_value_policy<py::reference_existing_object>());
}
